package com.panfeng.xcloud.scheduler.service.impl;

import com.panfeng.xcloud.scheduler.dao.mapper.ProfitAndFeeDetailMapperExt;
import com.panfeng.xcloud.scheduler.dao.mapper.UserWalletInfoMapperExt;
import com.panfeng.xcloud.scheduler.service.IDailyService;
import groovy.util.logging.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class DailyServiceImpl implements IDailyService {

    private static Logger log = LoggerFactory.getLogger(DailyServiceImpl.class);

    @Autowired
    private UserWalletInfoMapperExt userWalletInfoMapperExt;

    @Autowired
    private ProfitAndFeeDetailMapperExt profitAndFeeDetailMapperExt;

    @Override
    public void daily() {
        int i = userWalletInfoMapperExt.clearTodayProfit();
        log.info("总共有{}个用户的今日总盈亏清零", i);

        //更新盈利手续费详情表
        int j = profitAndFeeDetailMapperExt.clearTodayData();
        log.info("总共有{}个用户的今日盈利和今日手续费清零", j);
    }

}
